# -*- coding: utf-8 -*-
from odoo import models, api, fields, tools
from odoo.exceptions import UserError
import re


class report_temp_item(models.Model):

    _name = "proman.report_temp_item"
    _description = "报表模板清单"
    _table = "proman_report_temp_item"
    _order = "sequence"

    sequence = fields.Integer(string="排序",translate = 0)
    main_id = fields.Many2one(string="主单据号",comodel_name = 'proman.report_temp',ondelete = 'cascade',translate = 0)
    company_id = fields.Many2one(string="所属公司",comodel_name = 'res.company',default = lambda self:self.env.company,required = 1,translate = 0)
    name = fields.Char(string="清单名称",help = '请输入清单名称',translate = 0)
    indicator_category_id = fields.Many2one(string="指标分类",comodel_name = 'proman.base_indicator_category',related = 'indicator_id.indicator_category_id',readonly = 1,store = 1,translate = 0)
    indicator_id = fields.Many2one(string="指标名称",comodel_name = 'proman.base_indicator',translate = 0)
    uom_id = fields.Many2one(string="计量单位",comodel_name = 'uom.uom',related = 'indicator_id.uom_id',store = 1,translate = 0)
    value = fields.Char(string="参考值",translate = 0)
    memo = fields.Text(string="指标说明",translate = 0)
